package com.yict.csms.system.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 用户用户组表Entity
 * 
 * @author Patrick.Deng
 * 
 */
@Entity
@Table(name = "CSMS_USER_USERGROUP")
public class UserUserGroup {

	@Id
	@Column(name = "CUUGID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "csms_userUserGroup_seq")
	@SequenceGenerator(name = "csms_userUserGroup_seq", sequenceName = "SEQ_CSMS_USERUSERGROUP", allocationSize = 1, initialValue = 1)
	private Long cuugId;

	@ManyToOne
	@JoinColumn(name = "USERID")
	private User user;

	@ManyToOne
	@JoinColumn(name = "USERGROUPID")
	private UserGroup userGroup;

	@Column(name = "CREATEDATE")
	private Date createDate;

	@Column(name = "UPDATEDATE")
	private Date updateDate;

	/*@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CREATEPERSON")
	private User createPerson;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UPDATEPERSON")
	private User updatePerson;*/

	@Column(name = "CREATEPERSON")
	private Long createperson;

	@Column(name = "UPDATEPERSON")
	private Long updateperson;

	public Long getCuugId() {
		return cuugId;
	}

	public void setCuugId(Long cuugId) {
		this.cuugId = cuugId;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public UserGroup getUserGroup() {
		return userGroup;
	}

	public void setUserGroup(UserGroup userGroup) {
		this.userGroup = userGroup;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Long getCreateperson() {
		return createperson;
	}

	public void setCreateperson(Long createperson) {
		this.createperson = createperson;
	}

	public Long getUpdateperson() {
		return updateperson;
	}

	public void setUpdateperson(Long updateperson) {
		this.updateperson = updateperson;
	}

	/*public User getCreatePerson() {
		return createPerson;
	}

	public void setCreatePerson(User createPerson) {
		this.createPerson = createPerson;
	}

	public User getUpdatePerson() {
		return updatePerson;
	}

	public void setUpdatePerson(User updatePerson) {
		this.updatePerson = updatePerson;
	}*/
}
